/*
 * @Author: your name
 * @Date: 2021-12-01 15:07:23
 * @LastEditTime: 2021-12-13 10:37:39
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \tms-obc-web\src\app\shared\widget\st-widget.module.ts
 */
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { STWidgetRegistry } from '@delon/abc/st';
import { DelonFormModule, WidgetRegistry } from '@delon/form';
import { AddressModule, FileManagerModule } from '@shared';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import { NzDividerModule } from 'ng-zorro-antd/divider';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
import { NzStepsModule } from 'ng-zorro-antd/steps';
import { NgxTinymceModule } from 'ngx-tinymce';

// import { STWidgetRegistry } from '@delon/abc/st';
import { SharedModule } from '../shared.module';
import { AddressWidget } from './address/address.widget';
import { STCurrencyCHYWidget } from './currency-cny/curreny-cny.widget';
import { DictSelectWidget } from './dict-select/dict-select.widget';
import { SLFromToSearchWidget } from './from-to-search/from-to-search.widget';
import { EAFromToWidget } from './from-to/from-to.widget';
import { ImgWidget } from './img/img.widget';
import { NounWidget } from './noun/noun.widget';
import { PropertyValuesWidget } from './property-values/property-values.widget';
import { SpecValuesWidget } from './spec-values/spec-values.widget';
import { TinymceWidget } from './tinymce/tinymce.widget';
import { SHARED_ZORRO_MODULES } from '../shared-zorro.module';
import { SharedThirdModule } from '../shared-third.module';
import { DictSelectComponent } from '../components/dict-select/dict-select.component';

export const STWIDGET_COMPONENTS = [
  ImgWidget,
  AddressWidget,
  TinymceWidget,
  NounWidget,
  EAFromToWidget,
  SpecValuesWidget,
  PropertyValuesWidget,
  SLFromToSearchWidget,
  DictSelectWidget,
  STCurrencyCHYWidget,
  DictSelectComponent,
];

@NgModule({
  declarations: STWIDGET_COMPONENTS,
  imports: [
    CommonModule,
    FormsModule,
    ...SHARED_ZORRO_MODULES,
    SharedThirdModule,
    DelonFormModule.forRoot(),
    AddressModule,
    FileManagerModule,
    NzDividerModule,
    NzStepsModule,
    NzButtonModule,
    NzInputModule,
    NzDatePickerModule,
    NzInputNumberModule,
    NgxTinymceModule
  ],
  exports: [...STWIDGET_COMPONENTS],
  entryComponents: STWIDGET_COMPONENTS
})
export class STWidgetModule {
  constructor(widgetRegistry: WidgetRegistry, sTWidgetRegistry: STWidgetRegistry) {
    // widgetRegistry.register(EditorWidget.KEY, EditorWidget);
    widgetRegistry.register(ImgWidget.KEY, ImgWidget);
    widgetRegistry.register(AddressWidget.KEY, AddressWidget);
    widgetRegistry.register(TinymceWidget.KEY, TinymceWidget);
    widgetRegistry.register(NounWidget.KEY, NounWidget);
    widgetRegistry.register(EAFromToWidget.KEY, EAFromToWidget);
    widgetRegistry.register(SpecValuesWidget.KEY, SpecValuesWidget);
    widgetRegistry.register(PropertyValuesWidget.KEY, PropertyValuesWidget);
    widgetRegistry.register(SLFromToSearchWidget.KEY, SLFromToSearchWidget);
    widgetRegistry.register(DictSelectWidget.KEY, DictSelectWidget);

    sTWidgetRegistry.register(STCurrencyCHYWidget.KEY, STCurrencyCHYWidget);
  }
}
